const binarySearch = (nums, target) => {
    if(nums.length===0 || !nums.includes(target)) {
       return [-1,-1]
    }
    let arr=[]
    for(let i=0;i<nums.length;i++) {
        if(nums[i]===target){
             arr.push(i)
        }
    }
    if(arr.length===1){
        return [arr[0],arr[0]]
    }else{
        return [arr[0],arr[arr.length-1]]
    }
 
}
console.log(binarySearch([],0))
